package edu.jamestang.yeb.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author JamesTang
 * @date 2021/12/13 23:11
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class Resp implements Serializable {

    private long code;
    private String message;
    private Object obj;


    public static Resp success(String message){

        return new Resp(200,message,null);
    }

    public static Resp success(String message, Object obj){
        return new Resp(200, message, obj);
    }

    public static Resp error(String message){
        return new Resp(500, message, null);
    }

    public static Resp error(String message, Object obj){
        return new Resp(500, message, obj);
    }
}
